<?php

require_once(getcwd()."/modules/tfcms.class.php");

// Construct TFCMS class with default values.
// MUST be instantiated before anything else from the system.
try
{
	$tf = new TFCMS;
}

catch (Exception $e)
{
	try
	{
		TFCMS::disableVersionCheck();
		$tf = new TFCMS;
	}

	catch (Exception $e)
	{
		exit("<center>Website is down for maintenance.</center>");
	}
}

// After setting the site's title and sub title,
//  they can then be accessed through the constants,
//  TFCMS_TITLE and TFCMS_SUB_TITLE respectively.
$tf->setSiteTitle("TrueFusion CMS");
$tf->setSiteSubTitle("Making things easier for the rest of us");

// File path must be an absolute path.
// setHomePage() must come before parse_tpl()
$tf->setHomePage(__cwd."/home.html");

// File types must be separated by semicolons.
// e.g. ".html;.txt;.xml;.php"
// MUST be called before instantiating a category.
$tf->setGlobalFileTypes(".html");

/*
 *	Catgories are represented by the TFCMSCategory class.
 *	When a new category is instantiated they are automatically added
 *	 to the internal category list of the model.
 *
 */

/** API category **/
$api = new TFCMSCategory("API");
$api->setUrl("./docs/html/");

/** Wiki category **/
$wiki = new TFCMSCategory("Wiki");
$wiki->setUrl("http://code.google.com/p/tfcms/w/list");
$wiki->addUrls("Downloading and Installing=http://code.google.com/p/tfcms/wiki/DownloadingInstalling;".
			   "Configuration and Maintenance=http://code.google.com/p/tfcms/wiki/ConfigurationMaintenance;".
			   "Navigation System=http://code.google.com/p/tfcms/wiki/NavigationSystem");

/** Download category **/
$download = new TFCMSCategory("Download");
$download->setUrl("http://code.google.com/p/tfcms/source/checkout");

/** Partners category **/
$partners = new TFCMSCategory("Partners");
$partners->addUrls("TrueFusion=http://www.truefusion.org/");

//	Everything has been set, so finish.
//	Calling any other methods after renderHtml() serves no practical purpose
//	and may have unexpected results. Should be the last thing to call.
$tf->renderHtml();

?>
